<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wb="http://open.weibo.com/wb">
<head>
<title>关键词搜索日志</title>
<script>
		$(document).ready(function() {
			$("#initSearchIndex").addClass("active");
		});
</script>
</head>

<body>
	<h1 align="center">关键词搜索日志</h1>
	<c:if test="${not empty message}">
		<div id="message" class="alert alert-success"><button data-dismiss="alert" class="close">×</button>${message}</div>
	</c:if>
	
<form class="form-inline" action="/report/keywordReport"  method="post">

				<c:set var="cityCode1" value="${cityCode}"></c:set>
			 	<label>城市：</label> 
			 		<select id="cityCode" name="cityCode" style="width: 100px">
						<c:forEach var="city" items="${citys}">
							<option value='<c:out value="${city.id}"/>'
								<c:if test="${city.id==cityCode1}">selected</c:if> 
							><c:out value="${city.name}"/></option>
						</c:forEach>
					</select>
	
<label>分类： 
				<c:set var="assortCode" value="${assort}"></c:set>
				<select id="assort" name="assort">   
					<option value="0" >无分类</option>
					<c:forEach var="assort" items="${assorts}">
						<option value='<c:out value="${assort.id}"/>'
							<c:if test="${assort.id==assortCode}">selected</c:if> 
						><c:out value="${assort.name}"/></option>
					</c:forEach>
				</select>
			</label>


<label>关键词：</label> <input id="word", name="word" class="input-large"  value="${word}"/>
		<label>
		  <button type="submit" class="btn btn-primary " id="search_btn">查询</button>
		</label>	  	
	<div class="row">
		<label style="padding-left: 20px;">
			查询的结果总数:<b>${page.totalResult}</b>
		</label>
	</div>	

</form>	
	<table class="table table-condensed table-hover table-bordered "" contenteditable="false">
		<thead>
		<tr>
			<!--<th>ID</th>-->
			<th width="18%">搜索关键词</th>
			<th width="18%">切分词</th>
			<th width="18%">搜索时间</th>
			<th width="18%">检索目录</th>
			<th width="18%">命中记录数</th>
			<th width="18%">城市</th>
		</tr>
		</thead>
		<tbody>
			<c:forEach var="report" items="${page.result}" begin="0" varStatus="i" step="1">
				<tr>
					<!--<td>${report.id}&nbsp;</td>-->
					<td>${report.keyword}&nbsp;</td>
					<td>${report.tokenWords}&nbsp;</td>
					<td>${report.searchTime}&nbsp;</td>
					<td>${report.indexPath}&nbsp;</td>
					<td>${report.resultCount}</td>
					<td>${report.city}</td>   

				</tr>
			</c:forEach>
		</tbody>		
	</table>
	<div class="pagination pagination-right pagination-large">
<ul contenteditable="false">
	<li><a href="#" onclick="javascript:gotoPage(${page.currentPage-1});">上一页</a></li>
	<li class="disabled"><a href="#">1</a></li>
	<li class="active"><a href="#">2</a></li>
	<li><a href="#">3</a></li>
	<li><a href="#">4</a></li>
	<li><a href="#">5</a></li>
	<li class="disabled"><a href="#" onclick="javascript:gotoPage(${page.currentPage+1});">下一页</a></li>
</ul>
</div>
<div id="reportChart" class="row"></div>
</body>
</html>